﻿using OrderingFoot.Core.AspNetCore;
using Microsoft.Extensions.DependencyInjection;

namespace OrderingFoot.Core
{
    /// <summary>
    /// FilterExtension
    /// </summary>
    public static class FilterExtension
    {
        /// <summary>
        /// 结果过滤器
        /// </summary>
        public static IMvcBuilder AddMvcResultFilter(this IMvcBuilder mvcBuilder)
        {
            return mvcBuilder.AddMvcOptions(option =>
            {
                option.Filters.Add(typeof(UnaryResultFilterAttribute));
            });
        }
    }
}
